/**
 * 侧边栏样式
 */

.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: var(--sidebar-width);
  background-color: var(--color-background-primary);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  transition: width 0.3s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  
  // 侧边栏折叠状态
  .sidebar-collapsed & {
    width: var(--sidebar-collapsed-width);
    
    .logo span:not([data-icon]),
    .sidebar-nav ul li a span:not([data-icon]),
    .sidebar-footer .logout-btn span:not([data-icon]) {
      display: none;
    }
  }
}

// 侧边栏头部
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
  
  .logo {
    display: flex;
    align-items: center;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--color-primary);
    
    [data-icon] {
      margin-right: 0.75rem;
    }
  }
  
  .sidebar-toggle {
    background: none;
    border: none;
    color: var(--color-gray-600);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    
    &:hover {
      background-color: var(--color-gray-100);
    }
  }
}

// 侧边栏导航
.sidebar-nav {
  flex: 1;
  padding: 1rem 0;
  overflow-y: auto;
  
  ul {
    li {
      margin-bottom: 0.5rem;
      
      a {
        display: flex;
        align-items: center;
        padding: 0.75rem 1.5rem;
        color: var(--color-text-secondary);
        transition: all 0.2s ease;
        
        &:hover {
          background-color: var(--color-gray-100);
          color: var(--color-primary);
        }
        
        [data-icon] {
          margin-right: 0.75rem;
        }
      }
      
      &.active a {
        background-color: var(--color-primary-light);
        color: white;
      }
    }
  }
}

// 侧边栏底部
.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--color-gray-200);
  
  .logout-btn {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    border-radius: 0.25rem;
    color: var(--color-text-secondary);
    
    &:hover {
      background-color: var(--color-gray-100);
    }
    
    [data-icon] {
      margin-right: 0.75rem;
    }
  }
} 